home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
wics.zip
/
DIAL.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-03
|
2KB
|
81 lines
//==============================================================================================
//
// Windows Interface Construction Set
// Version 1.00
//
// DIAL.CPP - Dial (Volume Control) Class Source File
// Copyright ⌐ 1993 by Microdyne Development Technologies.
// All rights reserved.
//==============================================================================================
#include <dial.h>
TDial::TDial(PTWindowsObject AParent, int AnId, int X, int Y, PTModule AModule)
: TScrollBar (AParent, AnId, X, Y, 57, 57, FALSE, AModule)
{
}
TDial::TDial(PTWindowsObject AParent, int ResourceId, PTModule AModule)
: TScrollBar (AParent, ResourceId, AModule)
{
}
void TDial::GetRange(Rint LoVal, Rint HiVal)
{
GetDialRange(HWindow, &LoVal, &HiVal);
}
int TDial::GetPosition()
{
return GetDialPos(HWindow);
}
void TDial::SetRange(int LoVal, int HiVal, BOOL fRedraw)
{
SetDialRange (HWindow, LoVal, HiVal, fRedraw);
}
void TDial::SetPosition(int ThumbPos)
{
int LoVal , HiVal;
GetRange(LoVal, HiVal);
if ( ThumbPos > HiVal )
ThumbPos = HiVal;
else
if ( ThumbPos < LoVal )
ThumbPos = LoVal;
if ( ThumbPos != GetPosition() )
SetDialPos(HWindow, ThumbPos, TRUE);
}
/* Reads an instance of TDial from the passed ipstream. */
void *TDial::read(ipstream& is)
{
TWindow::read(is);
is >> LineMagnitude
>> PageMagnitude;
return this;
}
/* Writes the TScrollBar to the passed opstream. */
void TDial::write(opstream& os)
{
TWindow::write(os);
os << LineMagnitude
<< PageMagnitude;
}
TStreamable *TDial::build()
{
return new TDial(streamableInit);
}
TStreamableClass RegDial("TDial", TDial::build, __DELTA(TDial));